﻿using System;
using Castle.DynamicProxy;

namespace AspectMap
{
    /// <summary>Classes implementing this will handle custom code for particular aspects.</summary>
    public abstract class AttributeHandler
    {
        /// <summary>Takes an existing Action and surounds it with any required custom code.</summary>
        /// <param name="invocation">The existing invocation.</param>
        /// <param name="sourceAttribute">The attribute which caused the  </param>
        /// <returns>An action ready for the next step of the chain.</returns>
        public abstract Action<IInvocation> Surround(Action<IInvocation> invocation, Attribute sourceAttribute);
    }
}
